home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13967 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: top.MTS.Net!root
  2. From: root@top.MTS.Net
  3. Newsgroups: comp.lang.c
  4. Subject: problem recongnizing eof from pipe
  5. Date: Wed, 10 Apr 1996 20:44:57 -0500
  6. Organization: MTS Internet Services
  7. Message-ID: <Pine.A32.3.91.960410203441.19010A-100000-100000@top.MTS.Net>
  8. NNTP-Posting-Host: top.mts.net
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12. Hi.  I'm working on a program which passess it's data through an external 
  13. command using two pipes.  One pipe is connect to stdin of the forked 
  14. process and the other is connected to stdout.  The parent program has no 
  15. problems sending the data to the commend via the send pipe, however it 
  16. doesn't seem to recognize when the return stream is finished.
  17.  
  18. This is under AIX 4.1.3.  In the parent program I open the file 
  19. descriptor of the return pipe and read it with a fgetc command.  I am 
  20. currently checking for an EOF character (which never arrives) and check the 
  21. file descriptor for eof() condition.  Sometimes I get a couple of extra 
  22. characters, other times I lose them.
  23.  
  24. Any examples or suggestions would be welcome.  I've been using the 
  25. O'Reilly Using C on the Unix System as my reference.
  26.  
  27. If you can, please email to the addresses below.
  28.  
  29. Thanks
  30.  
  31. Wes Friesen
  32. wfriesn@mts.net or admin@mts.net
  33.